package com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.data.api.container;

import com.zhangfb95.crosschain.infra.model.Result;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.request.container.GetHeightApiReq;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.request.container.QueryBlockByNumberApiReq;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.request.container.QueryByChaincodeApiReq;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.request.container.QueryInstalledChainCodesApiReq;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.request.container.QueryTransactionByIDApiReq;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.request.container.SendApiReq;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.GetChainNameApiRes;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.GetHeightApiRes;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.QueryBlockByNumberApiRes;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.QueryByChaincodeApiRes;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.QueryInstalledChainCodesApiRes;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.QueryTransactionByIDApiRes;
import com.zhangfb95.crosschain.plugin.client.java.fabric2.infra.model.api.response.container.SendApiRes;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * @author zhangfubing
 * @since 2023/12/3
 */
@HttpExchange("/chain")
public interface ChainApi {

    @GetExchange("/getChainName")
    Result<GetChainNameApiRes> getChainName();

    @PostExchange("/send")
    Result<SendApiRes> send(@RequestBody SendApiReq req);

    @PostExchange("/queryByChaincode")
    Result<QueryByChaincodeApiRes> queryByChaincode(@RequestBody QueryByChaincodeApiReq req);

    @PostExchange("/queryInstalledChainCodes")
    Result<QueryInstalledChainCodesApiRes> queryInstalledChainCodes(@RequestBody QueryInstalledChainCodesApiReq req);

    @PostExchange("/getHeight")
    Result<GetHeightApiRes> getHeight(@RequestBody GetHeightApiReq req);

    @PostExchange("/queryTransactionByID")
    Result<QueryTransactionByIDApiRes> queryTransactionByID(@RequestBody QueryTransactionByIDApiReq req);

    @PostExchange("/queryBlockByNumber")
    Result<QueryBlockByNumberApiRes> queryBlockByNumber(@RequestBody QueryBlockByNumberApiReq req);
}
